<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>CKEditor</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../css/oksub.css">
</head>
<body>
    <div class="ok-body">
        <textarea id="editor"></textarea>
        <br/>
        <button type="button" class="layui-btn" onclick="setContent()">设置内容</button>
        <button type="button" class="layui-btn" onclick="appendContent()">追加内容</button>
        <button type="button" class="layui-btn" onclick="clearContent()">清空内容</button>
        <button type="button" class="layui-btn" onclick="getHtmlContent()">获取HTML内容</button>
        <button type="button" class="layui-btn" onclick="getTextContent()">获取TEXT内容</button>
    </div>
    <!--js逻辑-->
    <script src="https://cdn.ckeditor.com/ckeditor5/16.0.0/classic/ckeditor.js"></script>
    <script type="text/javascript">
        ClassicEditor.create(document.querySelector('#editor')).catch(error => {
            console.error(error);
        });
    </script>
</body>
</html>
